function modDirSize(imgDir,newDirName,factor)
%put all image of the directory in another directory with another size
%(factor)

imgFiles = dir(imgDir);
imgFileIndex = find(~[imgFiles.isdir]);
nbFiles = length(imgFileIndex);

for i = 1:nbFiles
        imgFilename = imgFiles(imgFileIndex(i)).name;
        
        img = imread(cat(2,imgDir,imgFilename));
        newImg = imresize(img,factor);
        
        newFilename = ['Resize_' imgFilename ];
        newDir = cat(2,imgDir,newDirName);
        imwrite(newImg,cat(2,newDir,newFilename),'bmp');
end
